package mushystuff.dtb.web.controller;

import javax.annotation.Resource;

import mushystuff.dtb.core.model.UserStory;
import mushystuff.dtb.core.service.ProductService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/userStoryCard.do")
public class UserStoryCard {

	@Resource
	private ProductService productService;

	protected Log log = LogFactory.getLog(this.getClass());

	@RequestMapping(method = RequestMethod.GET)
	public String reports(
			@RequestParam(value = "userStoryId", required = true) long userStoryId,
			ModelMap model) {
		UserStory userStory = productService.getUserStory(userStoryId);
		model.addAttribute(userStory);
		return "dtb.userStoryCard";
	}
}
